#ifndef _WX_INIT_H_
#define _WX_INIT_H_

#include "wx/defs.h"
#include "wx/wxchar.h"

extern bool wxEntryStart( int& argc, wxChar **argv );
extern void wxEntryCleanup();
extern int wxEntry( int& argc, wxChar **argv );
extern bool wxEntryStart( int& argc, char **argv );
extern int wxEntry( int& argc, char **argv );
extern bool wxInitialize( int argc = 0, wxChar **argv = NULL );
extern bool wxInitialize( int argc, char **argv );
extern void wxUninitialize();

class wxInitializer {
  public:
    wxInitializer( int argc = 0, wxChar **argv = NULL ) {
      m_ok = wxInitialize( argc, argv );
    }
    wxInitializer( int argc, char **argv ) {
      m_ok = wxInitialize( argc, argv );
    }
    bool IsOk() const { return m_ok; }
    operator bool() const { return m_ok; }
    ~wxInitializer() { if( m_ok ) wxUninitialize(); }
  private:
    bool m_ok;
};

#endif
